﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DACU.Tools;
using DACU.VkontakteApi.Base;

namespace DACU.UserControls
{
	/// <summary>
	/// Логика взаимодействия для VKUserProfile.xaml
	/// </summary>
	public partial class UserProfile
	{
		VKUserProfile _source;
		public VKUserProfile Source
		{
			get
			{
				//if (_source != null) return _source;
				return _source;
			}
			set
			{
				_source = UpdateForm(value);
			}
		}

		public Window OwnerWindow { get; set; }

		public UserProfile()
		{
			InitializeComponent();
		}

		public UserProfile(Window owner)
		{
			OwnerWindow = owner;
			InitializeComponent();
		}

		VKUserProfile UpdateForm(VKUserProfile profile)
		{
			if (profile == null) return profile;
			DataContext = profile;
			return profile;
		}
	}
}
